<?
include_once ("../modconfig.php");
include_once ("$ROOT_CLASS_DIR/tbs_class.php");
include_once ("$ROOT_CLASS_DIR/class_database.php");
include_once ("$ROOT_CLASS_DIR/class_common.php");
include_once ("$ROOT_CLASS_DIR/class_login.php");
include_once ("$ROOT_CLASS_DIR/class_pdf.php");

$ledger = $_POST['ledger'];
list($day,$month,$year) = explode("/", $ledger);
$SQL   = "SELECT count(*) FROM ais_history_ledger WHERE month='$month' AND
year = '$year' AND status='open'";
$ExistPeriod = $DBConnection->dbc->get_var($SQL);
$status = "open";
if (!$ExistPeriod){
    $status = "close";
}

$xml = "";

$xml .= "<status>";
$xml .= "<periodstatus>$status</periodstatus>";
$xml .= "</status>";

header('Content-Type: application/xml; charset=ISO-8859-1');
echo "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>";
echo $xml;
?>
